home *** CD-ROM | disk | FTP | other *** search
- Path: user1.mnsinc.com!huang
- From: huang@mnsinc.com (Szu-Wen Huang)
- Newsgroups: comp.lang.c
- Subject: Re: fast find algorithm
- Date: 7 Apr 1996 22:44:44 GMT
- Organization: Monumental Network Systems
- Message-ID: <4k9ggs$4ov@news1.mnsinc.com>
- References: <Dp8wE6.8DG@cix.compulink.co.uk> <PdvZxMlyZE9U088yn@ime.usp.br>
- NNTP-Posting-Host: user1.mnsinc.com
- X-Newsreader: TIN [version 1.2 PL2]
-
- Rogerio Brito (rbrito@ime.usp.br) wrote:
- : huang@mnsinc.com (Szu-Wen Huang) wrote:
- : >Falstaff (falstaff@xs4all.nl) wrote:
- : >...
- : >: Hashing is slightly slower than straight table lookup and can't be
- : >: used when you want to delete elements from your table.
- : >...
-
- : >Hashing can't be used when you want to delete elements? Please explain.
-
- : I think he is refering to elimination of the item of some
- : table. In such case, you should change your hash
- : function. But if you don't have memory problems, you can
- : simply ignore the location after it is "deleted". Or
- : depending on the implementation, you can simply unlink it
- : from your linked list (if it is the case, of course).
-
- Hash tables need to have null entries so the search will know that
- the item doesn't exist. I don't see why it is difficult to find
- the item to be deleted and overwrite it with the null entry. As
- you said, it'll work on linked lists, but it will work also on array
- implementations.
-